<template>
	<mescroll-uni :ref="'mescrollRef' + i" @init="mescrollInit" height="100%" :top="listTop" :down="downOption"
		@down="downCallback" :up="upOption" @up="upCallback" @emptyclick="emptyClick">
		<!-- 数据列表 -->
		<view class="goods-list single-column">
			<view class="goods-item margin-bottom" v-for="(item, index) in orderList" :key="index">
				<view class="item-box" v-if="tabObj.status < 100">
					<view>
						<view class="item-header">
							<view class="header-left">车次号: {{ item.journey_sn }}</view>
							<view class="header-right">{{getJourneyStatus(item)}}</view>
						</view>
						<view class="bottom-line">
							<view class="line"></view>
						</view>
						<view class="type-box">
							<view class="item-type">
								<text class="name">车牌号：</text>
								<text class="type-value"> {{ item.car_num }}</text>
							</view>
							<view class="item-type">
								<text class="name">司机电话：</text>
								<text class="type-value"> {{ item.driver_tel }} </text>
							</view>
						</view>
						<view class="remark">
							<text class="name">货物数量：</text>
							<text class="value">{{ item.waybill_goods_num }}</text>
						</view>
					</view>

					<view class="btns-box">
						<view v-if="getCarShowStatus(item)" class="pay" @click="toWaybillList(item)">到车运单</view>
					</view>

				</view>
				<view class="item-box" v-if="tabObj.status > 20">
					<u-card>
						<view class="item-box">
							<view @click="toDetail(item)">
								<view style="padding-top: 16rpx;">
									<u-row gutter="0">
										<u-col span="12">
											<view style="display: flex;flex-direction: row;justify-content: space-between;">
												<view>
													<text class="name" style="font-weight: bold;">订单号:{{ item.waybill_sn }}</text>
													
												</view>
												<view>
													<!-- <text class="name">运单等级：</text> -->
													<!-- <text class="value">{{ getLevel(item)}}</text> -->
													<text class="value" style="margin-right: 16rpx;"> {{ waybillStatus(item) }}</text>
												</view>
											</view>
										
										</u-col>
									</u-row>
								</view>
								<view class="bottom-line">
									<view class="line"></view>
								</view>
								<view class="type-box">
									<u-row gutter="0">
										<u-col span="3">
											<view class="good-item"> <text class="name">货物名称</text></view>
										</u-col>
										<u-col span="2">
											<view class="good-item"> <text class="name">包装</text></view>
										</u-col>
										<u-col span="2">
											<view class="good-item"> <text class="name">数量</text></view>
										</u-col>
										<u-col span="2">
											<view class="good-item"> <text class="name">总(KG)</text></view>
										</u-col>
										<u-col span="2">
											<view class="good-item"> <text class="name">总(方)</text></view>
										</u-col>
									</u-row>
									<u-row gutter="0" v-for="(goodItem ,row) in item.goods" :key="row">
										<u-col span="3">
											<text class="value">{{ goodItem.goods_name }}</text>
										</u-col>
										<u-col span="2">
											<text class="value">{{ goodItem.goods_pack }}</text>
										</u-col>
										<u-col span="2">
											<text class="value">{{ goodItem.goods_nums }}</text>
										</u-col>
										<u-col span="2">
											<text class="value"> {{ goodItem.total_weight }}</text>
										</u-col>
										<u-col span="2">
											<text class="value">{{ goodItem.total_volume }}</text>
										</u-col>
									</u-row>
									<u-row gutter="0">
										
										<u-col span="6">
											<view class="item-flex-row">
												<text class="name">运单等级：</text>
												<text class="value">{{ getLevel(item)}}</text>
											</view>
										</u-col>
										<u-col span="6">
											<view class="item-flex-row">
												<text class="name">目的城市：</text>
												<text class="value">{{ getDestinationCity(item) }}</text>
											</view>
										</u-col>
									</u-row>
									<u-row gutter="0">
										<u-col span="6">
											<text class="name">二级发货凭证：{{ getDepartPic2(item) }}</text>
										</u-col>
										<u-col span="6">
											<text class="name">一级到货凭证：{{ getArrivePic1(item) }}</text>
										</u-col>
									</u-row>
									<u-row gutter="0">
										<u-col span="6">
											<text class="name">一级发货凭证：{{ getDepartPic1(item) }}</text>
										</u-col>
										<u-col span="6">
											<text class="name">分拨中心到货凭证：{{ getAllocatePic1(item) }}</text>
										</u-col>
									</u-row>
									<u-row gutter="0">
										<u-col span="12">
											<text class="name">分拨凭证：{{ getAllocatePic2(item) }}</text>
										</u-col>
										
									</u-row>
									<u-row gutter="0">
										<u-col span="12">
											<text class="name">备注：{{ item.remark }}</text>
										</u-col>
									</u-row>
								</view>
							</view>
							<view class="btns-box">
								<view class="pay" v-if="getAllocateImgBtnShow(item)" @click="carLoading(item)">分拨凭证</view>
								<view class="qoute" v-if="getAllocationBtnShow(item)" @click="allocationClick(item)">分拨</view>
								<view class="pay" v-if="getArriveBtnShow(item)" @click="arriveClick(item)">到达</view>
								<view class="del" v-if="getPayBtnShow(item)" @click="payClick(item)">支付</view>
								<view class="cancel" v-if="getAddBtnShow(item)" @click="addClick(item)">添加轨迹</view>
								<view class="pay" v-if="getSignBtnShow(item)" @click="signClick(item)">签收</view>
							</view>
										
						</view>
					</u-card>
				</view>
			</view>
		</view>
		<!-- <view v-if="orderList.length == 0 && emptyShow"><ns-empty text="暂无订单" :isIndex="false" :emptyType="emptyType"></ns-empty></view> -->
		<loading-cover ref="loadingCover"></loading-cover>
	</mescroll-uni>
</template>

<script>
	import listitem from './js/car-item.js';
	import MescrollMixin from '@/components/mescroll-uni/mescroll-mixins.js';
	import MescrollMoreItemMixin from '@/components/mescroll-uni/mixins/mescroll-more-item.js';

	export default {
		mixins: [MescrollMixin, MescrollMoreItemMixin, listitem], // 注意此处还需使用MescrollMoreItemMixin (必须写在MescrollMixin后面)
		data() {
			return {

			};
		},
		methods: {

		}
	};
</script>

<style lang="scss">
	@import './css/car.scss';
</style>